﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UserGrant.aspx.cs" Inherits="QuaManSys.Rights.UserGrant" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>用户授权</title>
    <link href="~/Css/index.css" rel="stylesheet" type="text/css" />
    <link href="~/Css/childindex.css" rel="stylesheet" type="text/css" />
    <link href="~/Css/GridView.css" rel="stylesheet" type="text/css" />

    <%--<script language="javascript" type="text/jscript">
        function $id(s) {
            return document.getElementById(s);
        }

        function copyToList(from, to) //from表示:包含可選擇專案的select物件名字 to表示:列出可選擇專案的select物件名字 //你可以根據你的具體情況修改
        {
            fromList = eval('document.forms[0].' + from);
            toList = eval('document.forms[0].' + to);
            if (toList.options.length > 0 && toList.options[0].value == 'admin') {
                toList.options.length = 0;
            }
            var sel = false;
            for (i = 0; i < fromList.options.length; i++) {
                var current = fromList.options[i];
                if (current.selected) {
                    sel = true;
                    if (current.value == 'admin') {
                        alert('不能选择这个角色!');
                        return;
                    }
                    txt = current.text;
                    val = current.value;
                    toList.options[toList.length] = new Option(txt, val);
                    fromList.options[i] = null;
                    i--;
                }
            }
            if (!sel) alert('未选择任何角色!');
        }
        function getdata() {
            var List = document.forms[0].lbOwnedRoles;
            var roles = $id("TRoleList");
            roles.value = "";
            var s = "";
            if (List.length != 0) {
                for (i = 0; i < List.length; i++) {
                    s += List.options[i].value + ",";
                }
            }

            roles.value = s;
        }
    </script>--%>

</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:Panel ID="TitlePanel" runat="server" CssClass="titlePadding">
        给<asp:Label ID="lblId" runat="server" ForeColor="Red"></asp:Label>授权
        <asp:Label ID="state" runat="server" Text="" Style="display: none;"></asp:Label>
    </asp:Panel>
    <div id="strinfo" runat="server" class="mbox pbox" visible="false">
        更新成功，请<asp:HyperLink ID="hlkReturn" runat="server" 
        NavigateUrl="~/Rights/UserManPage.aspx">返回</asp:HyperLink>。
    </div>
    <div class="gv" runat="Server">
        <asp:Panel ID="RolePanel" runat="server">
            <table width="500" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
                <tr>
                    <td width="200" height="30" bgcolor="#CCCCCC">
                        <div align="center">
                            选择角色</div>
                    </td>
                    <td width="100" bgcolor="#CCCCCC">
                        <div align="center" style="color: #FFFFFF;">
                        </div>
                    </td>
                    <td width="200" bgcolor="#CCCCCC">
                        <div align="center">
                            可选角色</div>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#FFFFFF">
                        <div align="center" style="margin: 10px;">
                            <asp:ListBox ID="lbOwnedRoles" runat="server" Style="width: 160px;" SelectionMode="Multiple"
                                Height="205px"></asp:ListBox>
                            <asp:TextBox ID="OldRoleList" runat="server" Style="display: none;"></asp:TextBox>
                            <asp:TextBox ID="TRoleList" runat="server" Style="display: none;"></asp:TextBox>
                        </div>
                    </td>
                    <td bgcolor="#FFFFFF">
                        <div align="center">
                            <asp:Button ID="btn_plus" runat="server" Text="   <<   " 
                                onclick="btn_plus_Click" />
                            <br />
                            <br />
                            <asp:Button ID="btn_subtract" runat="server" Text="   >>   " 
                                onclick="btn_subtract_Click" />
                            <br />
                            <br />
                            <asp:Button ID="btn_saverole" runat="server" Text=" 保 存 " OnClick="btn_saverole_Click"  /><br />
                            <br />
                            按下CTRL鍵<br />
                            可以多選
                        </div>
                    </td>
                    <td bgcolor="#FFFFFF">
                        <div align="center" style="margin: 10px;">
                            <asp:ListBox ID="lbRoles" runat="server" Style="width: 160px;" SelectionMode="Multiple"
                                Height="205px"></asp:ListBox>
                        </div>
                    </td>
                </tr>
            </table>
        </asp:Panel>
    </div>
    </div>
    </form>
</body>
</html>
